Repository navigation
providers: degrade undeclared reasoning levels down the declared ladder - #599
Merged
Merged
Conversation
This was referenced Nov 27, 2026
caigee-cmd
approved these changes
Nov 27, 2026
caigee-cmd
left a comment
Owner
There was a problem hiding this comment.
Declared levels pass through unchanged; an undeclared level walks down the ladder and never up, and a request below the floor lands on the cheapest declared tier instead of the model default. Unknown levels still use the default. WorkBuddy's no-off path uses the cheapest thinking tier. Scoped to provider behavior; the release.yml change from the original commit is not here.
Owner
|
合入。声明过的档位原样转发;模型没声明的档位只向下退、不向上提;低于下限的请求落到最便宜的已声明档,不再退回可能更高的模型默认值。未知档位仍走默认值。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
ResolveReasoningLevelonly degradedmax/xhigh; every other undeclared level fell through toReasoningDefault, which can be higher than what the client asked for.noneon a model that cannot disable thinking was especially wrong: it was promoted to the model default instead of the cheapest thinking tier.Change
internal/providers/reasoning.go: one neutral ladder (none < low < medium < high < xhigh < max). A declared level is forwarded untouched; an undeclared level walks down to the nearest declared lower tier and never up; a request below the model floor lands on the cheapest declared tier instead of the default. Unknown levels still fall back to the default.internal/providers/workbuddy/mapping.go:noneon a model that cannot turn thinking off usesLowestThinkingOption(the cheapest thinking tier) rather than the default switch.LowestThinkingOptionadded for adapters that need an explicit off request to become the lowest thinking tier.release.yml's explicit-version input from the same original commit is not included; this PR is provider behavior only.Tests
go test ./internal/providers/...passes.reasoning_test.gocovers declared, undeclared-lower, below-floor, unknown andnonecases; WorkBuddy toggle tests cover the no-off model path.